
{*
@author Ermek
@copyright Hire-Experts LLC
@version Avatar 1.01
*}

{include file='header.tpl'}

{assign var='avatar_width' value=$user->level_info.level_photo_width}
{assign var='avatar_height' value=$user->level_info.level_photo_height}

<script type="text/javascript">

window.addEvent('domready', function() {ldelim}
	he_avatar_choose.construct();

	{if $he_avatar_crop}
	he_avatar.avatar_width = {$avatar_width};
	he_avatar.avatar_height = {$avatar_height};
	he_avatar.construct('{$crop_photo}');
	{else}
		he_avatar.construct_no_crop('{$crop_photo}');
	{/if}
{rdelim});

</script>

<table class='tabs' cellpadding='0' cellspacing='0'>
<tr>
<td class='tab0'>&nbsp;</td>
{section name=cat_loop loop=$cats}
  <td class='tab2' NOWRAP><a href='user_editprofile.php?cat_id={$cats[cat_loop].subcat_id}'>{lang_print id=$cats[cat_loop].subcat_title}</a></td><td class='tab'>&nbsp;</td>
{/section}
{if $user->level_info.level_photo_allow != 0}<td class='tab1' NOWRAP><a href='user_editprofile_photo.php'>{lang_print id=762}</a></td><td class='tab'>&nbsp;</td>{/if}
{if $user->level_info.level_profile_style != 0 || $user->level_info.level_profile_style_sample != 0}<td class='tab2' NOWRAP><a href='user_editprofile_style.php'>{lang_print id=763}</a></td>{/if}
<td class='tab3'>&nbsp;</td>
</tr>
</table>

<img src='./images/icons/editprofile48.gif' border='0' class='icon_big' />
<div class='page_header'>{lang_print id=769}</div>
<div class="clear"></div>
<br /><br />

<div class="he_avatar">

<div class="avatars">
	<div class="photo_upload">
		<div class="header">{lang_print id=690701020}</div>
		<div class="portal_content" style="height: 105px;">
			<div class="user_thumb">
				<img src='{$user->user_photo("./images/nophoto.gif")}' class='photo' width='100' height='100' border='0' alt='' />
			</div>
			<div class="description">
				{lang_print id=713}
			</div>
		</div>
	</div>
	<div class="choose_avatar">
		<div class="header">{lang_print id=690701001}</div>
		<div class="portal_content" style="height: 105px;">
			<table>
				<tr>
					<td align="right" width="10%">
						<a href="javascript://" id="choose_avatar_back"><img border="0" src="./images/icons/arrow_back.gif"/></a>
					</td>
					<td>
						<div style="width: 430px">
						<div class="avatar_slider" id="avatar_slider">
						{foreach from=$avatars item=avatar name=avatars}
							{assign var=show_block value=$smarty.foreach.avatars.first}
							{counter assign=avatar_count}
							{if $avatar_count%6==1}<div class="avatars_block {if $show_block}active_block{/if}">{/if}
								<img id="avatar_{$avatar.id}" class="select_avatar" src="./uploads_admin/avatar/{$avatar.filename}" border="0" height="60" width="60"/>
							{if $avatar_count%6==0}</div>{/if}
						{/foreach}
						{if $avatar_count%6!=0}</div>{/if}
						<div style="clear: both;"></div>
						</div>
					</td>
					<td align="left" width="10%">
						<a href="javascript://" id="choose_avatar_next"><img border="0" src="./images/icons/arrow_next.gif"/></a>
					</td>
			</tr>
			<tr>
				<td colspan="3" align="center">
				<form method="post">
					<input type="hidden" name="task" value="choose_avatar"/>
					<input type="hidden" name="avatar_id" id="choosen_avatar_id"/>
					<input class="button" id="choose_selected" type="button" value="{lang_print id=690701002}"/>
				</form>
				</td>
			</tr>
			</table>
		</div>
	</div>
	<div style="clear: both;"></div>
</div>
<br/>
<div class="photo_crop">
	<div class="header">{lang_print id=690701003}</div>
	<div class="portal_content">
		<b>{lang_print id=690701021}</b><br/>
		<div>
			<form method="post" enctype="multipart/form-data">
			{lang_print id=290}&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="file" name="avatar_file" onchange="this.form.submit();"/>
				<input type="hidden" name="task" value="photo_for_crop"/>
			</form>
		</div><br /><br />
		{if $crop_photo}
			<div>{lang_print id=690701004}</div>
			<div class="photo_block" id="photo_block"></div>
			<div class="he_preview_cont">
			{if $he_avatar_crop}
				<div class="user_thumb" style="width:{$avatar_width}px; height:{$avatar_height}px;">
					<div class="preview_block" id="preview_block" style="width:{$avatar_width}px; height:{$avatar_height}px;"></div>
				</div>
				<div class="description" style="padding-left: {$avatar_width+15}px;">
					<b>{lang_print id=690701005}</b><br/>
					<div>{lang_print id=690701006}</div>
					<form method="post">
						<input type="hidden" name="left" id="avatar_left"/>
						<input type="hidden" name="top" id="avatar_top"/>
						<input type="hidden" name="height" id="avatar_height"/>
						<input type="hidden" name="width" id="avatar_width"/>
						
						<input type="hidden" name="task" value="crop_avatar"/>						
						<input type="button" class="button" id="crop_avatar_btn" value="{lang_print id=690701007}"/>
					</form>
				</div>
				<div class="clr"></div>
			{else}
				<form method="post">
					<input type="hidden" name="task" value="no_crop_save"/>				
					<center><input type="submit" class="button" value="{lang_print id=690701022}"/></center>
				</form>
			{/if}
			</div>
		{else}
			{lang_print id=690701008}
		{/if}
	</div>
</div>

</div>
{include file='footer.tpl'}